<#include "/@inc/funcMacros.ftl">
<#assign className = TriaGram + "EA" + Prefix + LateType>
<#assign baseName = TriaGram + Prefix + LateType>
<#assign IDLName = TriaGram + "IA" + Prefix + LateType>
<#include "/@inc/copyright.txt">
<@pp.renameOutputFile name=className+"Factory.h">
</@pp.renameOutputFile>

//===================================================================
//
// ${className}Factory.h
// Provides implementation to interface ${IDLName}Factory
//
//===================================================================
#ifndef ${className}Factory_H
#define ${className}Factory_H

// System framework
#include "CATBaseUnknown.h"        // needed as base implementation class
#include "CATBSTR.h"               // needed to use OLE strings
class     CATBaseDispatch;         // needed as operating system independant IDispatch interface

// InfInterfaces framework
#include "CATIAApplication.h"      // needed as root interface for CATIA object
class CATIAReference;              // needed as a specification handle to OLE objects

// Local framework
#include "${IDLName}.h"  // needed as object created by the factory

//-----------------------------------------------------------------------
// Class extending the Part Root Feature - MechanicalPart - in order to
// provide a Custom Factory implementation
//-----------------------------------------------------------------------

class ${className}Factory : public CATBaseUnknown
{
  CATDeclareClass;

  public:

    // Standard constructors and destructors
    ${className}Factory ();
    virtual ~${className}Factory ();

    // CATIABase interface methods

    // Returns CATIA as an application
    HRESULT  get_Application(CATIAApplication *& opiApplicationOnCATIA);
        // Returns the parent class as regards the exposed modelization
    HRESULT __stdcall get_Parent(CATBaseDispatch *& opiBaseOnOLEParent);

    // Returns the entity name
    HRESULT           get_Name(CATBSTR         & oName);
    // Sets the entity name
    HRESULT           put_Name(const CATBSTR   & iName);

    // Gives an child exposed object when this object is considered as a container
    HRESULT GetItem(const CATBSTR & iName, CATBaseDispatch *& opiBaseOnChildObject);

    // ${IDLName}Factory interface methods

    // Creates a new ${LateType} with given inputs
    // but does not append it in any tool
	HRESULT  __stdcall Create${LateType}(
<#list Attributes as attrib>  <#t>
<#-- Check for sp_IN spec  -->
<#if attrib.facet == "sp_IN">
<#switch attrib.type>
	<#case "tklist_spec"><#t>
	<#case "tklist_component"><#t>
			const CATSafeArrayVariant  * ipList${attrib.name},
	<#break>
	<#case "tk_boolean"><#t>
            boolean          ib${attrib.name} ,
	<#break>
	<#case "tk_integer"><#t>
            int          in${attrib.name} ,
	<#break>
	<#case "tk_double"><#t>
            double          id${attrib.name} ,
	<#break>
	<#case "tk_string"><#t>
            CATBSTR          iString${attrib.name} ,
	<#break>
<#case "tk_specobject"><#t>
<#case "tk_component"><#t>
            CATIAReference          *  ipiReference${attrib.name} ,
</#switch>
</#if>  
</#list>
                ${IDLName}    *& opi${Prefix}${LateType} ) ;

	HRESULT  __stdcall Create${LateType}(${IDLName}    *& opi${Prefix}${LateType} ) ;
				
  private:
  // In order to avoid public implementation by compilers
  ${className}Factory (${className}Factory &);
  ${className}Factory& operator=(${className}Factory&);
};

#endif
